import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Index from '@/components/index'
import Menu1 from "@/components/Menu1.vue";
import SubMenu1  from "@/components/SubMenu1.vue";
import SubMenu2 from "@/components/SubMenu2.vue";
import Vuex1 from '@/components/Vuex1.vue';

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'HelloWorld',
      component: HelloWorld
    },{
      path: '/index',
      name: 'Index',
      component: Index
    },{
      path: '/menu1',
      name: 'Menu1',
      component: Menu1,
      children: [
        {
          path: '/menu1/subMenu1',
          component: SubMenu1
        },{
          path: 'subMenu2', //简化写法，类似 /menu1/subMenu2
          component: SubMenu2
        },{
          path: '',
          redirect: '/menu1/SubMenu2'
        }
      ]
    },
    {
      path: 'vuex1',
      name: Vuex1
    }
  ]
})
